package demo4;

import java.util.ArrayList;
import java.util.List;

/**
 * @author lfg
 * @version 1.0
 */
public class OutOfMemoryTest {

    //-Xmx20m
    //-XX:+HeapDumpOnOutOfMemoryError
    //-XX:HeapDumpPath=test.dump
    public static void main(String[] args) {
        List<byte[]> list = new ArrayList<>();

        for (int i = 0; i < 25; i++) {
            //1M
            list.add(new byte[1 * 1024 * 1024]);
        }

    }
}
